package com.example.a22310.myapplication.Beans;


import android.databinding.BaseObservable;
import android.databinding.Bindable;
import android.databinding.BindingAdapter;
import android.view.View;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;

import java.io.Serializable;
import java.util.List;

import static com.example.a22310.myapplication.GloableClass.Yuejian.IMG_URL;

public class Attention {


    private int code;
    private List<AttentiondataBean> attentiondata;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public List<AttentiondataBean> getAttentiondata() {
        return attentiondata;
    }

    public void setAttentiondata(List<AttentiondataBean> attentiondata) {
        this.attentiondata = attentiondata;
    }

    public static class AttentiondataBean extends BaseObservable implements Serializable {
        public AttentiondataBean()
        {

        }


        public AttentiondataBean(String attentionid,  String userid, String clubid, String name,
                                 String pic, String status)
        {
            this.attentionid = attentionid;
            this.userid = userid;
            this.clubid=clubid;
            this.name =name;
            this.pic = pic;
            this.status=status;

        }
        @BindingAdapter("pic")
        public static void loadInternetImage(ImageView iv, String pic) {
            pic = IMG_URL+pic;
            Picasso.with(iv.getContext()).load(pic).into(iv);
        }
        @Override
        public String toString() {
            return "AttentiondataBean{" +
                    "attentionid='" + attentionid + '\'' +
                    ", userid='" + userid + '\'' +
                    ", clubid='" + clubid + '\'' +
                    "pic='" + pic + '\'' +
                    "name='" + name + '\'' +
                    '}';
        }

        public void onItemClick(View view){
//         Intent intent=new Intent(view.getContext(),OrderDetail.class);

            AttentiondataBean attentionlist = new  AttentiondataBean();
            attentionlist.setAttentionid(getAttentionid());
            attentionlist.setUserid(getUserid());
            attentionlist.setClubid(getClubid());
            attentionlist.setPic(getPic());
            attentionlist.setName(getName());
            attentionlist.setStatus(getStatus());

//                intent.putExtra("Order", OrderlistBean);
//                view.getContext().startActivity(intent);
        }


        @Bindable

        private String attentionid;
        private String userid;
        private String clubid;
        private String name;
        private String pic;
        private String status;

        public String getAttentionid() {
            return attentionid;
        }

        public void setAttentionid(String attentionid) {
            this.attentionid = attentionid;
        }

        public String getUserid() {
            return userid;
        }

        public void setUserid(String userid) {
            this.userid = userid;
        }

        public String getClubid() {
            return clubid;
        }

        public void setClubid(String clubid) {
            this.clubid = clubid;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getPic() {
            return IMG_URL+pic;
        }

        public void setPic(String pic) {
            this.pic = pic;
        }
        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }
    }
}
